#include <bits/stdc++.h>

using namespace std;
#define int long long
const int inf = 0x3f3f3f3f;

void solve()
{
	string s;
	cin >> s;
	stack<char> st;
	for (int i = 0; i < s.size(); i++)
	{
		if (i == 0) st.push(s[i]);
		else
		{
			if (st.empty())
			{
				cout << "YES" << endl;
				return;
			}
			else if (st.top() == '(' && s[i] == ')') st.pop();
			else st.push(s[i]);
		}
	}
	cout << "NO" << endl;
}

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int _ = 1;
	cin >> _;
	while (_--)
	{
		solve();
	}
	return 0;
}